home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / prg_casm / snpd9611.zip / STRREPL.C < prev    next >
C/C++ Source or Header  |  1996-11-24  |  1KB  |  37 lines

  1. .I 0 3
  2. /* +++Date last modified: 24-Nov-1996 */
  3.  
  4. /*
  5. .D 1 1
  6. .I 18 2
  7. ** strrepl: Replace OldStr by NewStr in string Str contained in buffer
  8. **          of size BufSiz.
  9. .D 19 2
  10. .I 32 14
  11. **
  12. **  NOTE: The name of this funtion violates ANSI/ISO 9899:1990 sec. 7.1.3,
  13. **        but this violation seems preferable to either violating sec. 7.13.8
  14. **        or coming up with some hideous mixed-case or underscore infested
  15. **        naming. Also, many SNIPPETS str---() functions duplicate existing
  16. **        functions which are supported by various vendors, so the naming
  17. **        violation may be required for portability.
  18. */
  19.  
  20. #if defined(__cplusplus) && __cplusplus
  21.  extern "C" {
  22. #endif
  23.  
  24. char *strrepl(char *Str, size_t BufSiz, char *OldStr, char *NewStr)
  25. .D 33 3
  26. .I 50 4
  27. #if defined(__cplusplus) && __cplusplus
  28.  }
  29. #endif
  30.  
  31. .I 81 1
  32.       /* Repeat until all occurrences replaced */
  33. .D 82 1
  34. .I 89 1
  35.                   Start = strrepl(Start, BufLeft, argv[1], argv[2]);
  36. .D 90 1
  37.